package ncrnadb.ncinetview.internal.owrapper;

import java.util.Map;
import java.util.TreeMap;

public enum Source {
	UNKNOWN("UNKNOWN",""),
	//GENERIC_SYMBOL("GENERIC_SYMBOL",""),
	//GENERIC_NAME("GENERIC_NAME",""),
	GENERIC("GENERIC",""),
	
	GENERIC_ACCESSION_NUMBER("GENERIC_ACCESSION_NUMBER",""),
	GENERIC_ALIAS("GENERIC_ALIAS",""),
	HGNC("HGNC",""),
	ENZYME("ENZYME",""),
	ENTREZ_GENE("ENTREZ_GENE",""),
	ENSEMBL("ENSEMBL",""),
	UNIGENE("UNIGENE",""),
	REFSEQ("REFSEQ",""),
	CCDS("CCDS",""),
	VEGA("VEGA",""),
	OMIM("OMIM",""),
	UNIPROT("UNIPROT",""),
	UCSC("UCSC",""),
	RGD("RGD",""),
	MGD("MGD",""),
	PUBMED("PUBMED",""),
	MIRBASE_NAME("MIRBASE_NAME",""),
	MIRBASE_ACCESSION_NUMBER("MIRBASE_ACCESSION_NUMBER",""),
	NONCODE_V4("NONCODE","v4"),
	NONCODE_V3("NONCODE", "v3"),
	LNCRNADB("LNCRNADB",""),
	CIRC2TRAITS("CIRC2TRAITS",""),
	HMDD("HMDD",""),
	HMDD_2("HMDD","2"),
	LNCRNADISEASE("LNCRNADISEASE",""),
	MIRANDOLA_1_6("MIRANDOLA","1.6"),
	NPINTER("NPINTER",""),
	NPINTER_2_0("NPINTER","2.0"),
	MIRTARBASE("MIRTARBASE",""),
	STARBASE_V2_0("STARBASE","2.0")
	;
	
	public String name;
	public String version;
	private Source(String name, String version){
		this.name = name;
		this.version = version;
	}
	
	
	
	public String compact(){
		if(version!=null && version.length()>0)
			return name+"_"+version;
		else 
			return name;
	}
	
	
	public final static Map<String, Source> compactMap = new TreeMap<String,Source>();
	static{
		for(Source s : Source.values()){
			compactMap.put(s.compact(), s);
		}
	}
	
	public static Source get(String name, String version){
		if(version==null || version.length()==0)
			return compactMap.get(name);
		else
			return compactMap.get(name+"_"+version);
	}
	
	public static Source getByCompant(String compactName){
		return compactMap.get(compactName);
	}
}
